package ooday08;

public interface InterfaceDemo {
    public static final int num = 5;

    public abstract void show();

    int getNum = 5;  //默认public static final

    void test();   //默认public abstract
    //int number;   //编译错误，常量必须声明同时初始化
    //void say(){}  //编译错误，抽象放啊不能有方法
}

//演示接口的实现
interface Inter1 {
    void show();

    void test();
}

class Aoo implements Inter1 {
    public void show() {
    }//重写接口中的抽象方法时，必须加public权限

    public void test() {
    }

    //演示接口的多实现
    interface Inter2 {
        void show();
    }

    interface Inter3 {
        void test();
    }

    abstract class Boo {
        abstract void say();
    }

    class Coo extends Boo implements Inter2, Inter3 {
        public void show() {
        }

        public void test() {
        }

        @Override
        void say() {

        }
    }

    //演示接口继承接口
    interface Inter4 {
        void show();
    }

    interface Inter5 extends Inter4 {
        void test();
    }

    class Doo implements Inter5 {
        public void test() {
        }

        public void show() {
        }
    }
}
